<template>
    <div class="sky-background"
     :class="{ 'animation-active': animationActive }"
     >
    <!-- <div class="sky-background"
     
     > -->
        <div class="sun">
            
        </div>
        
        <div class="cloud">
                <div class="cloud-part"></div>
                <div class="cloud-part"></div>
                <div class="cloud-part"></div>
                
            </div>
        
      </div>
  </template>
  
  <script setup>
  import { ref, onMounted } from 'vue';
  
  const animationActive = ref(false);
  
  onMounted(() => {
    // 延迟激活动画，以确保初始状态显示后再开始动画
    setTimeout(() => {
      animationActive.value = true;
    }, 500);
  });
  </script>
  
  <style scoped>

  .sky-background {
    width: 260px;
    
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(to bottom, #4a3db2, #7a5bdf);
    /* z-index: -2; */
  }

  .weather-container{
    width: max-content;
    height: max-content;
    
  }
  
  .sun {
    position: absolute;
    cursor: pointer;
    width: 70px;
    height: 70px;
    /* left: 0px;
    top: -0px; */
    margin:0px 0px 30px 40px;
    background: radial-gradient(circle at 30% 30%, #f98501, #ffc907);
    border-radius: 50%;
    box-shadow: 0 0 90px #ffeb3b;
  }
  
  .cloud {
    position: relative;
    left: 50px;
    top: 10px;
    width: 260px;
    height: 80px;
  }
  .filer{
    backdrop-filter: blur(2px); 
    -webkit-backdrop-filter: blur(2px); 
  }
  
  .cloud-part {
    position: absolute;
    background-color: white;
    border-radius: 50px;
    filter: blur(5px);
  }
  
  .cloud-part:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 0px;
    left: -5px;
    border-radius: 50%;
    opacity: 1;
  }
  
  .cloud-part:nth-child(2) {
    width: 110px;
    height: 60px;
    top: 40px;
    left: 15px;
    /* border-right: 1px solid #c6c6c6; */
    /* box-shadow: 0 0 0 10px #8d8d8d6b; */
    opacity: 1;
    z-index: 1;
  }

  
  .cloud-part:nth-child(3) {
    width: 80px;
    height: 70px;
    top: 30px;
    left: 55px; 
    background: linear-gradient(120deg, #ffffff, #ffffff);
    opacity: 1;
  }
  
  .text {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 24px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  }
  
  /* 动画效果 */
  @keyframes cloudMove {
    0% {
      transform: translateX(0);
    }
    50% {
      transform: translateX(20px);
    }
    100% {
      transform: translateX(0);
    }
  }
  
  @keyframes sunPulse {
    0% {
      box-shadow: 0 0 50px #ffeb3b;
    }
    50% {
      box-shadow: 0 0 100px #ffeb3b;
    }
    100% {
      box-shadow: 0 0 50px #ffeb3b;
    }
  }
  
  .animation-active .cloud {
    animation: cloudMove 5s infinite ease-in-out;
  }
  
  .animation-active .sun {
    animation: sunPulse 3s infinite ease-in-out;
  }
  </style>